<template>
    <div class="box">
        <div class="header">
            <h1>大咖云集，你知道的大神齐聚MAN学院</h1>
            <p>"百川异源，而皆归于海" 越来越多的名师汇聚MAN，倾力为业界输送人才</p>
        </div>

        <div class="teaching-features">
            <h2>全程面授</h2>
            <ul>
                <li>多年经验在课堂上面对面倾囊相授，甚牛而毕之</li>
                <li>拒绝机械的填鸭式单向输出</li>
            </ul>

            <h2>更完美的授课方式</h2>
            <ul>
                <li>fiveman建立了完善的讲师选拔培育制度</li>
                <li>确保每位讲师都是技术经验与授业解惑两方面的高手</li>
                <li>以学以致用为导向，授人以鱼更授人以渔</li>
            </ul>

            <h2>更优秀的教育人才</h2>
            <ul>
                <li>讲师精通皮带手法，又有各自的拿手绝活</li><br>
                <li>教学态度端正严谨，授课风格灵活多样、幽默风趣</li>
                <li>秉持'纯粹、务实、平等、开放'的尚硅谷精神，不断精进</li>
            </ul>
        </div>

        <div class="teachers-container">
            <h2>FIVEMAN名师团队</h2>
            <div class="teachers-grid">

                <div v-for="teacher in teachers" :key="teacher.id" class="teacher-card">
                    <div class="teacher-image">
                        <img :src="teacher.image" alt="教师照片">
                    </div>
                    <div class="teacher-info">
                        <h3>{{ teacher.name }}</h3>
                        <p class="position">{{ teacher.position }}</p>
                        <p class="introduce">{{ teacher.introduce }}...</p>
                        <div class="teacher-skills">
                            <span v-for="(skill, index) in teacher.skill.split(' ')" :key="index" class="skill-tag">
                                {{ skill }}
                            </span>
                        </div>
                    </div>
                </div>

            </div>
        </div>

        <div class="support-services">
            <h2>持续赋能，为学员成长保驾护航</h2>
            <p>从入学到就业后，尚硅谷始终在你身边，助力学员整个职业生涯持续提升</p>

            <div class="service-stages">
                <div class="stage">
                    <h3>入学前</h3>
                    <ol>
                        <li>入学测验 - 多方面考察适不适合学、适合学什么技术方向</li>
                        <li>个性化预习方案 - 根据学员具体情况制定，帮你提前进入状态</li>
                    </ol>
                </div>

                <div class="stage">
                    <h3>技术学习期</h3>
                    <p>技术老师、辅导老师、班主任全程贯穿 | 技术学习 | 项目实战 | 学习效果测评 | 辅导答疑 | 生活帮助</p>
                </div>

                <div class="stage">
                    <h3>面试求职</h3>
                    <p>就业老师1v1面试指导 | 职业素养课 | 简历指导 | 模拟面试 | 面试推荐</p>
                </div>

                <div class="stage">
                    <h3>毕业后</h3>
                    <p>三年免费谷学莞SVIP | 职后跟踪 - 毕业后仍可按需学习，免费充电，持续提升</p>
                    <p>扶上马，再送一程，帮助学员解决工作中的问题</p>
                </div>
            </div>
        </div>

        <div class="contact-section">
            <h2>现在就与学习导师聊一聊</h2>
            <div class="contact-options">
                <a href="#" class="contact-btn">电话咨询</a>
                <a href="#" class="contact-btn">关注微信</a>
                <a href="#" class="contact-btn">视频下载</a>
            </div>
        </div>
    </div>
</template>

<script setup>
import { ref, onMounted } from 'vue';

import http from '@/http';
// 定义教师数据响应式变量
const teachers = ref([]);

// 组件挂载时获取教师数据
onMounted(() => {
    http({
        method: 'get',
        url: 'cont/famous/'

    }).then(resp => {
        teachers.value.splice(0, teachers.length, ...resp.data.data)
        console.log(resp);

    }).catch(error => {
        console.log(error);

    })
})


</script>

<style scoped>
.box {
    color: white;
    /* min-width: 100vw; */
    /* margin: 0;
    padding: 0; */
    background-color: #3F97E4;
    font-family: 'Arial', sans-serif;
}

.header {
    text-align: center;
    padding: 40px 20px;
    background-color: #16213e;
}

.header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    font-weight: bold;
}

.header p {
    font-size: 1.2rem;
    color: #cccccc;
}

.teaching-features,
.teachers-container,
.support-services,
.contact-section {
    max-width: 1200px;
    margin: 0 auto;
    padding: 30px 20px;
}

.teaching-features h2,
.teachers-container h2,
.support-services h2,
.contact-section h2 {
    font-size: 1.8rem;
    margin-bottom: 20px;
    text-align: center;
    color: #4cc9f0;
}

.teaching-features ul {
    list-style-type: none;
    padding-left: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.teaching-features li {
    margin-bottom: 10px;
    line-height: 1.6;
    display: flex;
    justify-content: center;
    align-items: center;
}

.teachers-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 30px;
}

.teacher-card {
    background-color: #16213e;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
}

.teacher-card:hover {
    transform: translateY(-5px);
}

.teacher-image {
    width: 100%;
    height: 420px;
    overflow: hidden;
    /* background-position: center top; */
    /* 定位到顶部 */
    /* background-size: cover; */
    /* 按比例缩放图片 */    
}

.teacher-image img {
    width: 100%;
    height: auto;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.teacher-card:hover .teacher-image img {
    transform: scale(1.05);
}

.teacher-info {
    padding: 15px;
}

.teacher-info h3 {
    font-size: 1.3rem;
    margin-bottom: 5px;
    color: #4cc9f0;
}

.position {
    color: #7209b7;
    margin-bottom: 10px;
    font-weight: bold;
}

.introduce {
    color: #e94560;
    margin-bottom: 10px;
    font-size: 0.95rem;
    display: -webkit-box;
    -webkit-line-clamp: 5;
    /* 限制为2行 */
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

.skills {
    color: #f72585;
    font-size: 0.9rem;
}

.support-services {
    background-color: #16213e;
}

.service-stages {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-around;
    margin-top: 30px;
}

.stage {
    flex: 1;
    min-width: 250px;
    margin: 15px;
    padding: 20px;
    background-color: #0f172a;
    border-radius: 8px;
}

.stage h3 {
    color: #4cc9f0;
    margin-bottom: 15px;
    text-align: center;
}

.stage ol,
.stage p {
    padding-left: 20px;
    line-height: 1.6;
}

.contact-section {
    text-align: center;
    background-color: #16213e;
    padding: 40px 20px;
}

.contact-options {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 20px;
}

.contact-btn {
    display: inline-block;
    padding: 12px 25px;
    background-color: #4cc9f0;
    color: white;
    text-decoration: none;
    border-radius: 5px;
    font-weight: bold;
    transition: background-color 0.3s ease;
}

.contact-btn:hover {
    background-color: #3a86ff;
}

@media (max-width: 768px) {
    .header h1 {
        font-size: 2rem;
    }

    .teachers-grid {
        grid-template-columns: 1fr;
    }

    .service-stages {
        flex-direction: column;
    }

    .contact-options {
        flex-direction: column;
        gap: 10px;
    }
}

.teacher-skills {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.skill-tag {
    padding: 4px 12px;
    background-color: #f3f4f6;
    color: #4b5563;
    border-radius: 4px;
    font-size: 14px;
    transition: background-color 0.3s ease;
}

.skill-tag:hover {
    background-color: #e5e7eb;
}
</style>